<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .parent{
            background-color:green;
            /* 清除浮动 方法2 */
            /* overflow:hidden; */
        }
        /* 清除浮动 方法1： */
        /* .parent::after{
            clear:both;
            content: '';
            display:table;
        } */

        .parent2{
            height:100px;
            width:100px;
            background-color:yellow;  
        }
        .child{
            height:50px;
            width:50px;
            color:red;
            background-color:currentColor;
            float:left;
            /* isolation: isolate;//隔离 */
        }
        /* 清除浮动 方法3 */
        .clearfloatchild{
            clear: both;
        }
    </style>
</head>
<body>
    <div class="parent">
        <div class="child">11</div>
        <!-- 清除浮动 方法3 -->
        <div class="clearfloatchild"></div>
    </div>
    <div class="parent2">

    </div>
</body>
</html>